<?php
if ($_REQUEST['delete']){
	$sigtodelete = escapestr($_REQUEST['delete']);
	$query = "delete from `login` where `sig`='$sigtodelete' and `id`='$id'";
	$result = mysql_query($query);
	if ($result) 
		$SITE_MIDDLE .= FormatElement( GetLangString ( $lang , "txt_sessionkilled") , GetLangString ( $lang , "msg_sessionkilled")); 
	else 
		$SITE_MIDDLE .= FormatElement( GetLangString ( $lang , "txt_error") , GetLangString ( $lang , "msg_dberror"));
}




$query = "select * from `login` where `id`='$id'";
$result = mysql_query($query);
$sessions .= "<table border=1 width='100%'><tr><td><b>".  GetLangString ($lang, "txt_killsession") . "</b></td><td><b>" .
									GetLangString ($lang, "txt_fistlogin") . "</b></td><td><b>" .
									GetLangString ($lang, "txt_lastseen") . "</b></td><td><b>" .
									GetLangString ($lang, "txt_ip") . "</b></td><td><b>" .
									GetLangString ($lang, "txt_useragent") . "</b></td></tr>" ;

while ($session = mysql_fetch_array($result)){
$sessions .=   "<tr><td><a href='index.php?do=session&delete=".$session['sig']."'>".GetLangString ($lang, "txt_killsession")."</a></td><td>" . 	
							date("d-m-Y H:i:s",$session['time']) . "</td><td>" . 
							date("d-m-Y H:i:s",$session['lastseen']) . "</td><td>" . 
							$session['ip'] . "</td><td>" . 							   
							$session['agent'] . "</td></tr>";
}
$sessions .= "</table>";

$SITE_MIDDLE .= FormatElement( GetLangString ( $lang , "txt_sessionmanager") , GetLangString ( $lang , "msg_sessionmanager"). $sessions); 
?>